/* eslint-disable @typescript-eslint/no-var-requires */

const { GitRevisionPlugin } = require('git-revision-webpack-plugin');

const gitRevisionPlugin = new GitRevisionPlugin();

module.exports = {
  // git版本
  'process.env.GIT_VERSION': {
    VERSION: `"${gitRevisionPlugin.version()}"`,
    COMMITHASH: `"${gitRevisionPlugin.commithash()}"`,
    BRANCH: `"${gitRevisionPlugin.branch()}"`,
    LASTCOMMITDATETIME: `"${gitRevisionPlugin.lastcommitdatetime()}"`,
  },

  // 条件编译用变量
  'process.env.DEVELOPMENT': process.env.NODE_ENV === 'development',
};
